/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package e.z.blog.back.bean.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.nutz.dao.entity.annotation.*;

/**
 * 目录操作类，记录所有记录的目录，还有一个缺省目录，defTab他不能被修改和不能被删除，否
 *
 * 则肯定会引起数据逻辑错误！切记！
 *
 * @author EnzoZhong
 */
@Table( "t_s_blog_bean_tab" )
public class Tab {

        @Id
        @Comment( "序列号" )
        private Integer tabId;
        @Name
        @Comment( "目录名" )
        private String tabName;
        @Column
        @Comment( "翻译" )
        @ColDefine( type = ColType.TEXT )
        private Map<String , String> translate;
        @Column
        @Comment( "状态" )
        private Integer state;
        @Many( target = Essay.class , field = "tabId" )
        private List<Essay> essayList;

        public Tab () {
                translate = new HashMap();
        }

        public List<Essay> getEssayList () {
                return essayList;
        }

        public void setEssayList ( List<Essay> essayList ) {
                this.essayList = essayList;
        }

        public Map<String , String> getTranslate () {
                return translate;
        }

        public void setTranslate ( Map<String , String> translate ) {
                this.translate = translate;
        }

        public Integer getState () {
                return state;
        }

        public void setState ( Integer state ) {
                this.state = state;
        }

        public Integer getTabId () {
                return tabId;
        }

        public void setTabId ( Integer tabId ) {
                this.tabId = tabId;
        }

        public String getTabName () {
                return tabName;
        }

        public void setTabName ( String tabName ) {
                this.tabName = tabName;
        }

        @Override
        public boolean equals ( Object obj ) {
                if ( obj == null ) {
                        return false;
                }
                if ( getClass() != obj.getClass() ) {
                        return false;
                }
                final Tab other = ( Tab ) obj;
                if ( ( this.tabName == null ) ? ( other.tabName != null ) : !this.tabName.equals( other.tabName ) ) {
                        return false;
                }
                return true;
        }

        @Override
        public int hashCode () {
                int hash = 5;
                hash = 79 * hash + ( this.tabName != null ? this.tabName.hashCode() : 0 );
                return hash;
        }

        @Override
        public String toString () {
                return "Tab{" + "tabId=" + tabId + ", tabName=" + tabName + ", state=" + state + '}';
        }
}
